package cn.orangeframe.neon.domain.enums;

public enum TaskStatus {

    SCHEDULED(false, true),
    COMPLETED(true, true),
    COMPLETED_WITH_ERRORS(true, false),
    FAILED(true, false),
    FAILED_WITH_TERMINAL_ERROR(true, false),
    TIMED_OUT(true, false),
    SKIPPED(true, true),
    IN_PROGRESS(false, true)
    ;
    private boolean terminal;

    private boolean successful;

    TaskStatus(boolean terminal, boolean successful) {
        this.terminal = terminal;
        this.successful = successful;
    }

    public boolean isTerminal() {
        return terminal;
    }

    public boolean isSuccessful() {
        return successful;
    }
}
